-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TCF experience design improvements #4222
Conversation
Passing run #4523 ↗︎
Details:
Review all test suite changes for PR #4222 ↗︎ |
<div id="fides-banner-title" className="fides-banner-title"> | ||
{experience.title} | ||
</div> | ||
{showGpcBadge && bannerType !== "TCF" ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing in bannerType
to hide the GpcBadge
for the TCF banner/modal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm if its only purpose is whether or not to show the gpc badge, maybe instead of bannerType
we make the prop hideGpc
, then change above. I think that makes it a bit clearer for someone using this component exactly what that prop is going to do
const showGpcBadge = getConsentContext().globalPrivacyControl && !hideGpc;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually maybe a better idea is to modify the function getGlobalPrivacyControl
to query window.Fides.options.tcfEnabled
. if it's enabled, return false. then I don't think gpc would ever render for TCF, and it'd be tied to gpc logic, as opposed to component logic, which is nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that, much cleaner!
const dialog = new A11yDialogLib(node); | ||
dialog | ||
.on("show", () => (document.documentElement.style.overflowY = "hidden")) | ||
.on("hide", () => (document.documentElement.style.overflowY = "")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lightweight version of the scroll lock, the more robust version takes 1Kb https://a11y-dialog.netlify.app/advanced/scroll-lock/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amazing job @galvana ! I'm going to play around some more locally, but wanted to leave you some comments first!
onVendorPageClick?: () => void; | ||
buttonGroup: VNode; | ||
bannerType?: String; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't even know there was a String
! looks like we should prefer string
tho: https://stackoverflow.com/questions/14727044/what-is-the-difference-between-types-string-and-string
bannerType?: String; | |
bannerType?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or even better, would be to restrict this to the strings it can be, i.e. "TCF"|"notices"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ended up going away after refactoring the GPC check
<div id="fides-banner-title" className="fides-banner-title"> | ||
{experience.title} | ||
</div> | ||
{showGpcBadge && bannerType !== "TCF" ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm if its only purpose is whether or not to show the gpc badge, maybe instead of bannerType
we make the prop hideGpc
, then change above. I think that makes it a bit clearer for someone using this component exactly what that prop is going to do
const showGpcBadge = getConsentContext().globalPrivacyControl && !hideGpc;
}: { | ||
attributes: Attributes; | ||
experience: ExperienceConfig; | ||
children: ComponentChildren; | ||
onVendorPageClick?: () => void; | ||
modalType?: String; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same thing here—see my meandering comment thoughts about on bannerType
@@ -230,6 +258,7 @@ button.fides-banner-button.fides-banner-button-secondary { | |||
background: var(--fides-overlay-secondary-button-background-color); | |||
color: var(--fides-overlay-secondary-button-text-color); | |||
border: 1px solid var(--fides-overlay-primary-button-background-color); | |||
border-radius: var(--fides-overlay-button-border-radius); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm can this border-radius be defined on .fides-banner-button
instead of on the two hover states? or does that not work since the border isn't defined until the hover state? (just trying to see if we can cut down on one line of CSS 😵 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
@@ -243,7 +272,9 @@ button.fides-banner-button.fides-banner-button-tertiary { | |||
color: var(--fides-overlay-link-font-color); | |||
text-decoration: underline; | |||
cursor: pointer; | |||
line-height: 2em; | |||
font-weight: 500; | |||
font-size: var(--fides-overlay-font-size-body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm should all the buttons be this size by default?
} | ||
|
||
.fides-gpc-badge { | ||
text-transform: uppercase; | ||
padding: 0 4px; | ||
font-weight: 700; | ||
border-radius: var(--fides-overlay-button-border-radius); | ||
border-radius: 4px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be
border-radius: 4px; | |
border-radius: var(--fides-overlay-badge-border-radius); |
?
<div id="fides-banner-title" className="fides-banner-title"> | ||
{experience.title} | ||
</div> | ||
{showGpcBadge && bannerType !== "TCF" ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually maybe a better idea is to modify the function getGlobalPrivacyControl
to query window.Fides.options.tcfEnabled
. if it's enabled, return false. then I don't think gpc would ever render for TCF, and it'd be tied to gpc logic, as opposed to component logic, which is nice!
style={{ | ||
display: "flex", | ||
justifyContent: "space-between", | ||
alignItems: "center", | ||
gridColumn: 1, | ||
gridRow: 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this styling is doing anything, is it? since there's only the one item inside
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
style={{ | ||
display: "flex", | ||
justifyContent: "space-between", | ||
alignItems: "center", | ||
}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same thing here—I don't think this is doing anything since there's only one child element? trying to save you some kb 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay @galvana I'm done reviewing for now! let me know what you think of the comments I left. none of them are really blocking, but I think they're worth considering. awesome job, should be ready to merge soon! ✨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amaaaaazing!!!
@@ -13,6 +13,10 @@ declare global { | |||
* having to modify the browser before the script runs. | |||
*/ | |||
const getGlobalPrivacyControl = (): boolean | undefined => { | |||
if (window.Fides.options.tcfEnabled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's update the docstring above to also mention how we don't use GPC with TCF
Closes #4185
Description Of Changes
Updating default
fides.css
and some component functionality to match our new designs https://www.figma.com/file/dmEwdK3xZwjKfGVQ9t66xe/Fides-v.2-Master-Working-Files?node-id=10555%3A602217&mode=dev. The designs should match for the most part with the following exceptions:Code Changes
fides.css
and minor component changesSteps to Confirm
Pre-Merge Checklist
CHANGELOG.md